document.addEventListener('DOMContentLoaded', main);
function main() {
    // define variables.
    var renderEngine = new RenderEngine(document.getElementById('canvas'));

    square = {
        top: 10,
        left: 10,
        height: 100,
        width: 100,
        color: 'red',
        draw: function(context) {
            context.fillRect(this.top, this.left, this.height, this.width, this.color);
        }
    };

    renderEngine.start();
    renderEngine.draw(square);
};